Fix bug #17942 with pos-visible-in-window-p and image and BOB.
authorEli Zaretskii <eliz@gnu.org>
Sat, 5 Jul 2014 07:38:13 +0000 (10:38 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 5 Jul 2014 07:38:13 +0000 (10:38 +0300)
 src/xdisp.c (pos_visible_p): If CHARPOS is at BEGV, and there is a
 display property at BEGV, don't call move_it_to to move to a
 position before BEGV.

src/ChangeLog
src/xdisp.c

index 5ed2a13b6e0e45ef2a91c255756d7dc4be51da70..fcf7569538163e60e13e21e1792bc9e1ee161af7 100644 (file)
@@ -1,3 +1,9 @@
+2014-07-05  Eli Zaretskii  <eliz@gnu.org>
+
+       * xdisp.c (pos_visible_p): If CHARPOS is at BEGV, and there is a
+       display property at BEGV, don't call move_it_to to move to a
+       position before BEGV.  (Bug#17942)
+
 2014-07-05  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * syntax.c (find_defun_start): Try the cache even
index fe5d0f579d827496742b395f8bde1b6ef9cc216d..f5ddf8283149d227a0dfa3abc14df57c8d65061b 100644 (file)
@@ -1585,7 +1585,8 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
                  /* Move to the last buffer position before the
                     display property.  */
                  start_display (&it3, w, top);
-                 move_it_to (&it3, start - 1, -1, -1, -1, MOVE_TO_POS);
+                 if (start > BEGV)
+                   move_it_to (&it3, start - 1, -1, -1, -1, MOVE_TO_POS);
                  /* Move forward one more line if the position before
                     the display string is a newline or if it is the
                     rightmost character on a line that is